package com.zjj.learn.javaplus.pkg01.demo14;

public class Teacher2 extends Person{
    private String subject;

    public Teacher2(String name, Integer age,String subject) {
        super(name, age);
        this.subject = subject;
    }

    public void teach(){
        System.out.println(super.getName() + "老师，讲授" + this.getSubject() + "课");
    }

    @Override
    public void eat() {
        super.eat();
    }



    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }
}
